﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace HotelManagement.Common
{
    public class Goods
    {
        private int m_nID;

        public int ID
        {
            get { return m_nID; }
            set { m_nID = value; }
        }
        private string m_strName;

        public string Name
        {
            get { return m_strName; }
            set { m_strName = value; }
        }
        private int m_strWaringCount;

        public int WaringCount
        {
            get { return m_strWaringCount; }
            set { m_strWaringCount = value; }
        }
        private int m_strCount;

        public int Count
        {
            get { return m_strCount; }
            set { m_strCount = value; }
        }
        private float m_strPurchasePrice;

        public float PurchasePrice
        {
            get { return m_strPurchasePrice; }
            set { m_strPurchasePrice = value; }
        }
        private float m_strSalePrice;

        public float SalePrice
        {
            get { return m_strSalePrice; }
            set { m_strSalePrice = value; }
        }

        private string m_strDescription;

        public string Description
        {
            get { return m_strDescription; }
            set { m_strDescription = value; }
        }


        private DataTable m_datGoodsCollection;

        public DataTable GoodsCollection
        {
            get 
            {
                if (m_datGoodsCollection == null || 0 == m_datGoodsCollection.Columns.Count) 
                {
                    InitGoodsCollection();
                }
                return m_datGoodsCollection; 
            }
            set { m_datGoodsCollection = value; }
        }

        private void InitGoodsCollection() 
        {
            m_datGoodsCollection = new DataTable();
            m_datGoodsCollection.Columns.Add(COL_ID, typeof(string));
            m_datGoodsCollection.Columns.Add(COL_NAME, typeof(string));
            m_datGoodsCollection.Columns.Add(COL_WARINGCOUNT, typeof(int));
            m_datGoodsCollection.Columns.Add(COL_COUNT, typeof(int));
            m_datGoodsCollection.Columns.Add(COL_PURCHASEPRICE, typeof(double));
            m_datGoodsCollection.Columns.Add(COL_SALEPRICE, typeof(double));

        }

        public void ClearGoodsCollection()
        {
            m_datGoodsCollection.Clear();
            m_datGoodsCollection.Dispose();
        }

        private readonly string COL_ID = "ID";
        private readonly string COL_NAME = "NAME";
        private readonly string COL_WARINGCOUNT = "WARINGCOUNT";
        private readonly string COL_COUNT = "COUNT";
        private readonly string COL_PURCHASEPRICE = "PURCHASEPRICE";
        private readonly string COL_SALEPRICE = "SALEPRICE";





    }
}
